package productmanagementclient;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import productmanagementclient.publish.ProductRemote;
import productmanagementclient.rmi.ProductRemoteImpl;

public class SetupServer {
	public static void main(String[] args) throws Exception {
		// String[] command = new String[]{"rmiregistry","2020"};
		// Runtime.getRuntime().exec(command);
		Registry r = LocateRegistry.getRegistry();

		// Kien tao doi tuong
		ProductRemote server = new ProductRemoteImpl();

		// Dang ky doi tuong voi dich vu rmiregistry
		// Naming.rebind("rmi://localhost/productobject", server);
		r.rebind("client1", server);
		System.out.println("Publish client 1...");
	}
}
